<%-- 
    Document   : nuevoIngreso
    Created on : 19-jun-2009, 18:56:05
    Author     : Ale
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" session="false" import="domain.*, planner.*, java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>DOMECO</title>
        <script language="javascript" type="text/javascript" src="/js/validaciones.js"></script>
        <link href="style.css" rel="stylesheet" type="text/css">

             <style type="text/css">@import url(./js/calendar-blue2.css);</style>
        <script type="text/javascript" src="./js/calendar.js"></script>
        <script type="text/javascript" src="./js/calendar-es.js"></script>
        <script type="text/javascript" src="./js/calendar-setup.js"></script>

        <script type="text/javascript">
//inicializo el calendario
window.onload = function() {
  Calendar.setup({
    inputField: "fecha",
    ifFormat:  "%Y-%m-%d",
    button:     "mas"
  });

}
</script>

    </head>
    <body>

        <%if (request.getSession(false) != null) {%>
        <table align="center" width="1000" >
            <tr>
                <td>
                    <div id="menu" align="center"><jsp:include page="./menu principal.jsp"></jsp:include></div>
                    <br>

                    <p id="campoAzul" align="center" valign="middle" width="235px"><span id="blanco">Cuentas</span><br></p>
                    <span id="azulTitulo"> Insertar nuevo Ingreso</span>
                    <div id="general">
                        <div id="cuenta" align="right"  >

                            <form name="form" action="./Register?type=income&redir=C" method="post">
                                <table id="alert" class="curved">
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Cuenta:</span></td>
                                        <td><select name="bank" id="bank">
                                                <%
    Userdom u = (Userdom) request.getSession().getAttribute("user");
    Iterator it = new Operations().getBankaccountsList(u).iterator();
    while (it.hasNext()) {
        Bankaccount b = (Bankaccount) it.next();

                                                %>
                                                <option  value="<% out.print(b.getIdBank());%>"><% out.print(b.getName());%></option>

                                                <%
    }
                                                %>


                                        </select></td>
                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Concepto del ingreso:</span></td>
                                        <td><input name="concept"  type="text" value=""/></td>
                                    </tr>

                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Fecha del ingreso:</span></td>
                                        <td><input id="fecha" class="fecha" name="dateIncome" id="fecha" class="fecha" type="text" value="" readonly="readonly"/><button name="mas" id="mas" class="mas"></button><span id="azul">(yyyy-mm-dd)</span></td>
                                    </tr>

                                    <tr>
                                        <td><br></td>
                                    </tr>

                                    <tr>
                                        <td><span id="azul">Importe:</span></td>
                                        <td><input name="amount" type="text" value=""/></td>
                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>

                                    <tr align="center">

                                        <td><input name="aceptar" type="submit" value="" id="aceptar" onClick="javascript:return validar();"></td>
                                        <td><input type="button" value="" id="atras" onclick="javascript:history.back();"></td>
                                    </tr>

                                </table>









                            </form>

                                                        <br><br>
                            <br><br>

                        </div>
                        
                    </div>

                    <div id="abajo" align="center"><p>&copy;   Domeco &mdash; Proyecto Informático A&ntilde;o 2009 </p></div>
                </td>
            </tr>
        </table>
        <%} else {%>
        <jsp:forward page="./index.jsp"></jsp:forward>
        <%}%>
    </body>
</html>
